class ModelMeta(type):
    def __new__(cls, name, bases, attrs):
        model_class = super().__new__(cls, name, bases, attrs)

        if 'tablename' not in attrs:
            setattr(model_class, "tablename", name.lower())

        return model_class


class Modal(metaclass=ModelMeta):
    pass


class User(Modal):
    pass

if __name__ == '__main__':
    print(User.tablename)
